package org.niit.app

import org.niit.common.TApp
import org.niit.controller.{BlackListController, RealTimeController, TimeCountController}
import org.niit.handler.DataHandler

object BlackListApp extends App with TApp{

  start("local[*]","BlackList"){
    val blackListController = new BlackListController()
    val realTimeController = new RealTimeController()
    val timeCountController = new TimeCountController()
    //以前我们将获取Kafka的数据写在service的时候，会创建三个消费者以及三个消费者组
    //现在放到了App当中，只会创建一个消费者和一个消费者组
    val value = DataHandler.KafkaDataHandler("BD1", "AD1")
  // App (value)   --->  controller(value) ---> service(value)
    timeCountController.dispatch(value)
    realTimeController.dispatch(value)
    blackListController.dispatch(value)

    DataHandler.startAndAwait()

  }

}
